<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <table id="exam_chart_teacherdg">
        <thead>
            <tr>
                {volist name="list" id="vo"}
                    <th data-options="field:'{$vo}',sortable:true">{$vo}</th>
                {/volist}
            </tr>
        </thead>
    </table>
    <div id="exam_chart_teachertb">
        <form id="exam_chart_teacherForm" class="m5">
            <div>
                年级：
                <select id="grade" class="easyui-combobox" data-options="width:80,panelHeight:'auto', editable:false,url:'/compent/Util/gradeList',onSelect:changeGrade"></select>
                学科:
                <select id="subjectId" name="subjectId" class="easyui-combobox" data-options="width:80,panelHeight:'auto',url:'/compent/Util/subjectList',onSelect:changeSubject"></select>
                <select id="teacherId" name="teacherId" class="easyui-combobox" data-options="width:80,editable:false"></select>
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="queryOk('exam_chart_teacher')">查询</a>
                <a class="easyui-linkbutton" href="javascript:void(0)" data-options="iconCls:'icon-save'" onclick="zoutExcel('exam_chart_teacher','/examScore/exam_chart_teacher')">导出为EXCEL</a>
                <a class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="teacherChartPic()">历次考试成绩升降图</a>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        var url = "/examScore/exam_chart_teacher";
        $(function(){
            initDatagrid("exam_chart_teacher",url);
        })  
        function teacherChartPic(){
            var teacherName = $('#teacherId').combobox('getText');
            window.open(url + "/scoreChart?teacherName="+teacherName);
        }
        function changeGrade(record){
            var subjectId = $("#subjectId").combobox("getValue");
            if(subjectId) {
                var url="/compent/Util/teacherList?grade="+record.value+"&subjectId="+subjectId;
                $('#teacherId').combobox('setValue','');
                $('#teacherId').combobox('reload',url);
            }
        }
        function changeSubject(record){
            var grade = $("#grade").combobox("getValue");
            var subjectId = record.value;
            if(grade && subjectId) {
                var url="/compent/Util/teacherList?grade="+grade+"&subjectId="+subjectId;
                $('#teacherId').combobox('setValue','');
                $('#teacherId').combobox('reload',url);
            }
        }
        function queryOk(cf){
            var teacherName = $("#teacherId").combobox("getText");
            if(teacherName){
                $('#'+cf+'dg').datagrid('load',{teacherName:teacherName});
            }else{
                $.messager.alert('操作提示','请选择教师。');
            }
        }
        function zoutExcel(cf, url){
            var teacherName = $("#teacherId").combobox("getText");
            if(teacherName){
                window.location.href = url+"/exportExcel.html?teacherName=" + teacherName;
            }else{
                $.messager.alert('操作提示','请选择教师。');
            }
        }
    </script>
</body>
</html>